/*
 * @Description: 
 * @Author: fhw
 * @Date: 2023-03-26 15:05:23
 */
import { ApiProperty } from "@nestjs/swagger";
import { BaseEntity } from "src/common/entities/entities";
import { Column, Entity } from "typeorm";

@Entity('category')
export class CategoryEntity extends BaseEntity {
    /** 分类名称 */
  @ApiProperty({ example: 'categoryName', description: '分类名称' })
  @Column({
    type: 'varchar',
    comment: '分类名称',
    length: 50
  })
  categoryName: string;
  /** 是否显示,0:否；1:是 */
  @ApiProperty({ example: 'isShow', description: '是否显示,0:否；1:是' })
  @Column({
    comment: '是否显示,0:否；1:是',
    type: 'enum',
    default: 1,
    enum: [0, 1],
  })
  isShow: string;
  /** 排序 */
  @ApiProperty({ example: 'sort', description: '排序' })
  @Column({
    type: 'tinyint',
    comment: '排序',
    default: 0,
  })
  sort: number;
  /** 创建人 */
  @ApiProperty({ example: 'createById', description: '创建人' })
  @Column({ type: 'int', comment: '创建人' })
  createById: number;
  /** 更新人 */
  @ApiProperty({ example: 'updateById', description: '更新人' })
  @Column({ type: 'int', comment: '更新人', nullable: true })
  updateById: number;
}
